﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RuleCode.Table;
using RuleCode.Common;
using System.Data;

namespace ERPWebDemos.Forms
{
    public partial class Users_F : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
            if (!IsPostBack)
            {
                BindMainGridView();
            }
        }

        #region 数据绑定
        /// <summary>
        /// 绑定数据
        /// </summary>
        protected void BindMainGridView()
        {
            //string filter = "1=1";
            ////Users users = Users.Find(filter);
            //Users users = new Users();
            //users.PageSize = MainWebPager.PageSize;
            //DataTable dTable = users.Fetch(MainWebPager.CurrentPageIndex );
           
            ////users.UserID
            //MainWebPager.DataSource = dTable;
            //MainWebPager.DataBind();
            //NoDataDiv.Visible = (users.Count <= 0);
        }

        /// <summary>
        /// 页面当前页改变事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void MainWebPager_PageIndexChanged(object sender, RuleCode.Controls.PageChangedEventArgs e)
        {
            MainWebPager.CurrentPageIndex = e.NewPageIndex;
            BindMainGridView();
        }
        #endregion
    }
}


//RuleCode.Table.Users u = RuleCode.Table.Users.Find("1=1");
//            Label1.Text = u.UserID.ToString();


//            RuleCode.Table.Users u =  new Users ();
//            u.FilterString = "";
//            u.SortingString = "";
//            u.PageEnabled = true;
//            u.PageSize = 3;
//            u.Fetch(2);
//            Label1.Text = u.UserID.ToString();